<form role="form" data-toggle="validator" class="form-horizontal">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.name|htmlentities}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商家ID')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.merchant_id}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品分类')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.category_name|htmlentities}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品价格')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">￥{$row.price}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品库存')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.stock}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品描述')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.description|htmlentities}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品图片')}:</label>
        <div class="col-xs-12 col-sm-8">
            {if condition="$row.image"}
            <img src="{$row.image}" style="max-width: 200px; max-height: 200px;" class="img-thumbnail">
            {else/}
            <p class="form-control-static">无图片</p>
            {/if}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('创建时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.createtime}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('更新时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.updatetime}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('审核状态')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">
                {if condition="$row.audit_status eq 0"}
                    <span class="label label-danger">审核未通过</span>
                {elseif condition="$row.audit_status eq 1"/}
                    <span class="label label-success">审核通过</span>
                {elseif condition="$row.audit_status eq 2"/}
                    <span class="label label-warning">待审核</span>
                {/if}
            </p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('上下架状态')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">
                {if condition="$row.shelf_status eq 0"}
                    <span class="label label-warning">下架</span>
                {elseif condition="$row.shelf_status eq 1"/}
                    <span class="label label-success">上架</span>
                {/if}
            </p>
        </div>
    </div>
    {if condition="$row.reject_reason"}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('拒绝原因')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static text-danger">{$row.reject_reason|htmlentities}</p>
        </div>
    </div>
    {/if}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="button" class="btn btn-primary" onclick="closeLayer()">{:__('Close')}</button>
        </div>
    </div>
    
<script>
function closeLayer() {
    // 尝试多种方式关闭弹窗
    try {
        if (typeof parent.layer !== 'undefined') {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        } else if (typeof layer !== 'undefined') {
            layer.closeAll();
        } else if (window.parent && window.parent !== window) {
            window.parent.postMessage('closeLayer', '*');
        }
    } catch (e) {
        console.log('关闭弹窗失败:', e);
        // 最后尝试关闭窗口
        if (window.parent && window.parent !== window) {
            window.parent.location.reload();
        }
    }
}
</script>
</form>